﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class changeMail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["NEW"] != null)
        {
            LB2.Text = Session["NEW"].ToString();
        }
        else
        {
            Response.Redirect("MainPage.aspx");
        }

    }
    protected void change_Click(object sender, EventArgs e)
    {
        using (RegisterationDBEntities DB = new RegisterationDBEntities())
        {
            Student_Information select = (from SI in DB.Student_Information where SI.StudentName == LB2.Text select SI).FirstOrDefault();
            select.E_mail = newMailTextBox.Text;
            DB.SaveChanges();
            Response.Redirect("~/Updatetd.aspx");


        }

    }
}